
/*************************************************************************
* Copyright (c) 2008, ShenZhen Coship Electronic Ltd Co.
* All rights reserved.
* 
* File Name:		CDJpeg.h
* Summary:			interface for the CCDJpeg class.
* 
* Current Version:	1.0
* Author(s):
/------------------------------------------------------------------------/
revision			author				reason					date
1.0					Ding Ning			Initialize Version		2008-6-18
/------------------------------------------------------------------------/
*************************************************************************/


#if !defined(AFX_CDJPEG_H__493D3F37_74B1_4CB1_844B_D3EE7C528645__INCLUDED_)
#define AFX_CDJPEG_H__493D3F37_74B1_4CB1_844B_D3EE7C528645__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ICodec.h"
extern "C"
{
#include "../jpeg-6b/jinclude.h"
}
#include "../inc/DecBuf.h"

class CCDJpeg : public ICodec  
{
public:
	CCDJpeg();
	virtual ~CCDJpeg();
public:
	virtual BOOL Init(const char* pbuf, int len);
	virtual void Destroy();
	virtual int GetWidth();
	virtual int GetHeight();
	virtual int GetBPP();
	virtual BOOL Decode(const char* pbuf, int len, int subLen = 0);
	virtual void InitPicInfo();
	virtual char* GetPicBuff();
	virtual int getSrcLength();
	virtual int getDestLength();
	virtual char* GetJpgPicBuff();
	virtual LPBITMAPINFOHEADER getInfo();

private:
	MYBUF m_srcImage;
	MYBUF m_destImage;
	LPBITMAPINFOHEADER m_pInfo;
	int m_srcLength;
	int m_destLength;
};

#endif // !defined(AFX_CDJPEG_H__493D3F37_74B1_4CB1_844B_D3EE7C528645__INCLUDED_)
